package com.sogoodsoft.web.webservice;

import org.springframework.remoting.jaxrpc.ServletEndpointSupport;

import com.sogoodsoft.entity.account.Authority;
import com.sogoodsoft.entity.account.Role;
import com.sogoodsoft.entity.account.User;
import com.sogoodsoft.service.account.AccountManager;

public class AccountService extends ServletEndpointSupport {
	private AccountManager manage;
	
	protected void onInit(){
		manage = (AccountManager)this.getApplicationContext().getBean("accountManager");
	}
	public String hello(){
		
		return manage.findUserByLoginName("user").getEmail();
	}
	public User findUserByName(String name){
		User user = manage.findUserByLoginName(name);
		return user;
	}
	public Role findRoleById(long id){
		return manage.getRole(id);
	}
	public Authority findAutById(long id){
		return null;
	}
}
